//配置数据的结构
const { Schema, model } = require('mongoose');
const buildingSchema = new Schema({
    community_id: {
        type:Schema.Types.ObjectId,
        ref:"communityModel"
    },//小区
    buildingName:String,//楼栋
    buildingToward:String,//朝向
    buildingHeight:String,//楼高
    buildingStructure:String,//楼宇结构
    buildingUnit:String,//单元数
    buildingfloor:String,//楼层
       
}, { versionKey: false });
const HomeSchema = new Schema({
    homeUnit:String//单元
    ,homefloor:String//所在楼层
    ,homeNumber:String//房号
    ,homeToward:String//朝向
    ,homeArea:String//建筑面积
    ,homeWithin:String//套内面积
    ,homePublic:String//公摊面积
    ,apartment:String//房屋户型
       
}, { versionKey: false });
//配置数据模型
const HomeModel = model('HomeModel', HomeSchema, 'Home');
const buildingModel = model('buildingModel', buildingSchema, 'building');

//把配置的数据模型暴露出去
module.exports={
    HomeModel,buildingModel
}